<% if !object.nil? && object.errors.any? %>
  <%= content_tag("div", :class => defined?(compact) ? "compact_error" : "error") do %>
    <%= defined?(compact) ? "" : (object.errors.size > 1 ? "Errors:" : "Error:") %>
    <%= fix_error_messages(object.errors.full_messages.join(", ")) %>
  <% end %>
<% end %>